// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_i;

import java.io.IOException;
import java.io.InputStream;

// Referenced classes of package com.nnee.i:
//            c

public class cls_a extends InputStream
{

    public cls_a(InputStream inputstream)
    {
        if(inputstream == null)
        {
            throw new IllegalArgumentException("in is null");
        } else
        {
            a = inputstream;
            k = System.currentTimeMillis();
            return;
        }
    }

    public static void a()
    {
        synchronized(b)
        {
            c = d >> 2;
            d = 0;
        }
        if(e != null)
            e.a((byte)3, c);
        return;
       
    }

    private void a(int i1)
    {
        if(i1 <= 0)
            return;
        
        j = i1 + j;
        i = i1 + i;
        
        synchronized(b)
        {
            f += i1;
            d = i1 + d;
        }
        if(l != null)
            l.b((byte)5, i1);
        if(e != null)
            e.b((byte)7, i1);
        return;
         
    }

    public static void a(long l1)
    {
        f = l1;
    }

    public static void b(cls_c c1)
    {
        e = c1;
    }

    public static int e()
    {
        return c;
    }

    public static long f()
    {
        return f;
    }

    public void a(cls_c c1)
    {
        l = c1;
    }

    public int available()
    {
        try {
			return a.available();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return 0;
    }

    public void b()
    {
        
        h = i >> 2;
        i = 0;
        
        if(l != null)
            l.a((byte)1, h);
        
    }

    public int c()
    {
        return h;
    }

    public void close()
    {
        if(a != null)
        {
            try
            {
                a.close();
                super.close();
            }
            catch(IOException ioexception) { }
            a = null;
        }
    }

    public int d()
    {
        long l1 = (System.currentTimeMillis() - k) / 1000L;
        if(l1 <= 0L)
            l1 = 1L;
        return (int)((long)j / l1);
    }

    public int read()
    {
        int i1=0;
		try {
			i1 = a.read();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        if(i1 > -1)
            a(1);
        return i1;
    }

    public int read(byte abyte0[])
    {
        return read(abyte0, 0, abyte0.length);
    }

    public int read(byte abyte0[], int i1, int j1)
    {
        int k1=0;
		try {
			k1 = a.read(abyte0, i1, j1);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        a(k1);
        return k1;
    }

    private static Object b[] = new Object[0];
    private static int c = 0;
    private static int d = 0;
    private static cls_c e;
    private static long f = 0L;
    private static final int g = 2;
    protected InputStream a;
    private int h;
    private int i;
    private int j;
    private long k;
    private cls_c l;

    static 
    {
        c = 0;
        d = 0;
        f = 0L;
    }
}
